<?php
/**
 * Created by PhpStorm.
 * User: yuyj
 * Date: 17-1-3
 * Time: 下午7:54
 */

namespace common\services\myhtsq;


use common\repositories\myhtsq\ErpBusinessUnitRepository;
use common\services\BaseService;
use yii\helpers\ArrayHelper;

class ErpBusinessUnitService extends BaseService
{

    private $repository;

    /**
     * @inheritdoc
     */
    public function __construct(ErpBusinessUnitRepository $repository, $config = [])
    {
        $this->repository = $repository;

        return parent::__construct($config);
    }

    public function getDepartmentNameByDepartmentId($buguid)
    {
        $data = $this->repository->getDepartmentNameByDepartmentId($buguid);

        return ArrayHelper::map($data, 'BUGUID', 'BUName');
    }
    
}